package xyz.heyaoshare.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 项目配置类
 * @author YueHe
 * @version 0.0.1
 * @since 2025/6/25 上午10:54
 */
@Data
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties("project.configuration")
public class ProjectProperties {

    /**
     * web 自定义配置
     */
    private WebProperties web;

    /**
     * 日志配置
     */
    private LogProperties log;

    /**
     * Minio存储配置
     */
    private MinioProperties minio;

    /**
     * 上传配置
     */
    private UploadProperties upload;


    @Bean
    @ConfigurationProperties("project.configuration.web")
    public WebProperties webProperties() {
        return new WebProperties();
    }

    @Bean
    @ConfigurationProperties("project.configuration.log")
    public LogProperties logProperties() {
        return new LogProperties();
    }

    @Bean
    @ConfigurationProperties("project.configuration.minio")
    public MinioProperties minioProperties() {
        return new MinioProperties();
    }

    @Bean
    @ConfigurationProperties("project.configuration.upload")
    public UploadProperties uploadProperties() {
        return new UploadProperties();
    }

}